###验证回文####
# str = input("请输入你要验证的字符串")
# k=0
# for i in range(len(str)) :
#     j = len(str) - i -1
#     if  str[i] == str[j] :
#             k+=1
# if k >= len(str):
#     print("是回文")
# else:
#     print("不是回文")
######找出列表过半的元素
# list1 = [1,1,2,2,2]
# set1 = set(list1)
# for i in set1 :
#     num = list1.count(i)
#     if num > len(list1)//2 :
#         print(f"次数过半的是{i}")
########输出最小回文####
# s = input("请输入你要输出最小回文的字符串")
# res = s[::-1]
# k = 0
# for i,j in enumerate(s):
def judge(s):
    s1=s[::-1]
    m=0
    for i in range(len(s)):
        if s[i]==s1[i]:
            m+=1
    if m==len(s):
        return True
    return False
i=str(input('请输入一个字符串，:'))
if not judge(i):
    s1 = i[::-1]
    m=0
    if not judge(s1):
        while s1[len(s1)-1]==i[m] and m<len(i):
          m+=1
        s2=s1+i[m:len(i)]
        print(s2,end='\n')
    else:
        print(i,end='\n')


































